<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>审核光谱</title>
<%-- 全站样式 --%>
<jsp:include page="/WEB-INF/jsps/template_style.jsp"></jsp:include>

</head>
<body>
<form action="<c:url value='/queryApplySpectrum.do'/>" method="post">
	<div class="page-container">
		<%--侧边栏 --%>
		<jsp:include page="/WEB-INF/jsps/sidebar.jsp"></jsp:include>

		<div class="main-content">
			<%--导航栏 --%>
			<jsp:include page="/WEB-INF/jsps/navbar.jsp"></jsp:include>
			<div class="page-title">
				<div class="title-env">
					<h1 class="title">审核光谱</h1>
					<p class="description">您可以在此页面上，对操作员上传的光谱进行审核</p>
				</div>
			</div>
			<div class="row">
				<!-- Tabbed panel 2 -->
				<div class="panel panel-default panel-tabs">
					<!-- Add class "collapsed" to minimize the panel -->
					<div class="panel-heading">
						<!--<div class="panel-options">-->
						<ul class="nav nav-tabs">
							<li class="active"><a href="#tab-4" data-toggle="tab">待审核</a></li>
							<li><a href="#tab-5" data-toggle="tab" id="applySuccess">已通过</a></li>
							<li><a href="#tab-6" data-toggle="tab">未通过</a></li>
						</ul>
						<!--</div>-->
					</div>
					<div class="panel-body">
						<div class="tab-content">
							<div class="tab-pane active" id="tab-4">
								<div class="panel panel-default">
									<div class="panel-heading">
										<h3 class="panel-title">待审核通过的光谱</h3>
									</div>
									<div class="panel-body">

										<table class="table table-bordered table-striped" id="example-2">
											<thead>
												<tr>
													<th class="no-sorting">全选<input type="checkbox" class="cbr">
													</th>
													<th>光谱名称</th>
													<th>申请时间</th>
													<th>申请人</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody class="middle-align">
												<c:forEach var="session_apply" items="${applysDatas }">
													 <c:if test="${session_apply[4] == 3}">
													
													 <tr>
														<td><input type='checkbox' class='cbr'></td>
														<td>${session_apply[1]}</td>
														<td>${session_apply[2]}</td>
														<td>${session_apply[3]}</td>
														<td>
														<a href="/queryApplySpectrum.do?applicationID=${session_apply[5]}" class="btn btn-info btn-sm btn-icon icon-left">查看</a>
														</td>
													</tr> 
													</c:if>
												</c:forEach>
											</tbody>
										</table>
									</div>
								</div>
							</div>
							<div class="tab-pane" id="tab-5">
								<div class="panel panel-default">
									<div class="panel-heading">
										<h3 class="panel-title">已通过审核的光谱</h3>
									</div>
									<div class="panel-body">
										<table class="table table-bordered table-striped" id="example-3">
											<thead>
												<tr>
													<th class="no-sorting">全选<input type="checkbox" class="cbr">
													</th>
													<th>光谱名称</th>
													<th>申请时间</th>
													<th>申请人</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody class="middle-align">
												<c:forEach var="session_apply" items="${applysDatas }">
                                                     <c:if test="${session_apply[4] == 2}">
                                                     <tr>
                                                        <td><input type='checkbox' class='cbr'></td>
                                                        <td>${session_apply[1]}</td>
                                                        <td>${session_apply[2]}</td>
                                                        <td>${session_apply[3]}</td>
                                                        <td>
                                                        <a href="/queryApplySpectrum.do?applicationID=${session_apply[5]}" class="btn btn-info btn-sm btn-icon icon-left">查看</a>
                                                        </td>
                                                    </tr> 
                                                    </c:if>
                                                </c:forEach>
											</tbody>
										</table>
									</div>
								</div>
							</div>
							<div class="tab-pane" id="tab-6">
								<div class="panel panel-default">
									<div class="panel-heading">
										<h3 class="panel-title">未审核通过的光谱</h3>
									</div>
									<div class="panel-body">
										<table class="table table-bordered table-striped" id="example-4">
											<thead>
												<tr>
													<th class="no-sorting">全选<input type="checkbox" class="cbr">
													</th>
													<th>光谱名称</th>
													<th>采用标准</th>
													<th>申请人</th>
													<th>操作</th>
												</tr>
											</thead>
											<tbody class="middle-align">
												<c:forEach var="session_apply" items="${applysDatas }">
                                                     <c:if test="${session_apply[4] == 0}">
                                                     <tr>
                                                        <td><input type='checkbox' class='cbr'></td>
                                                        <td>${session_apply[1]}</td>
                                                        <td>${session_apply[2]}</td>
                                                        <td>${session_apply[3]}</td>
                                                        <td>
                                                        <a href="/queryApplySpectrum.do?applicationID=${session_apply[5]}" class="btn btn-info btn-sm btn-icon icon-left">查看</a>
                                                        </td>
                                                    </tr> 
                                                    </c:if>
                                                </c:forEach>
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>

					</div>
				</div>
			</div>

			<%--页脚 --%>
			<jsp:include page="/WEB-INF/jsps/footer.jsp"></jsp:include>
		</div>
	</div>

	<div class="page-loading-overlay">
		<div class="loader-2"></div>
	</div>

	<%-- 尾部内容 --%>
	<jsp:include page="/WEB-INF/jsps/template_tail.jsp" />

	<link rel="stylesheet" href="assets/js/datatables/dataTables.bootstrap.css">
	<!-- Imported scripts on this page -->
	<script src="assets/js/select2/select2.min.js"></script>
	<script src="assets/js/datatables/js/jquery.dataTables.min.js"></script>
	<script src="assets/js/datatables/dataTables.bootstrap.js"></script>
	<script src="assets/js/jquery-ui.min.js"></script>
	<script src="assets/js/selectboxit/jquery.selectBoxIt.min.js"></script>
	
	<!--Specific JS for this page-->
	<script type="text/javascript">
		jQuery(document)
				.ready(
						function($) {
							$("#example-2,#example-3,#example-4").dataTable(
									{
										aLengthMenu : [
												[ 5, 10, 25, 50, 100, -1 ],
												[ 5, 10, 25, 50, 100, "所有" ] ]
									});
							// Replace checkboxes when they appear
							var $state1 = $("#example-2 thead input[type='checkbox']");
							var $state2 = $("#example-3 thead input[type='checkbox']");
							var $state3 = $("#example-4 thead input[type='checkbox']");
							$("#example-2").on('draw.dt', function() {
								cbr_replace();

								$state1.trigger('change');
							});
							$("#example-3").on('draw.dt', function() {
								cbr_replace();

								$state2.trigger('change');
							});
							$("#example-4").on('draw.dt', function() {
								cbr_replace();

								$state3.trigger('change');
							});
							// Script to select all checkboxes
							$state1
									.on(
											'change',
											function(ev) {
												var $chcks = $("#example-2 tbody input[type='checkbox']");

												if ($state1.is(':checked')) {
													$chcks
															.prop('checked',
																	true)
															.trigger('change');
												} else {
													$chcks.prop('checked',
															false).trigger(
															'change');
												}
											});
							$state2
									.on(
											'change',
											function(ev) {
												var $chcks = $("#example-3 tbody input[type='checkbox']");

												if ($state2.is(':checked')) {
													$chcks
															.prop('checked',
																	true)
															.trigger('change');
												} else {
													$chcks.prop('checked',
															false).trigger(
															'change');
												}
											});
							$state3
									.on(
											'change',
											function(ev) {
												var $chcks = $("#example-4 tbody input[type='checkbox']");

												if ($state3.is(':checked')) {
													$chcks
															.prop('checked',
																	true)
															.trigger('change');
												} else {
													$chcks.prop('checked',
															false).trigger(
															'change');
												}
											});
						});
	</script>
	</form>
</body>

</html>